package com.example.pc.adapterdemo.ui;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;

import com.example.pc.adapterdemo.R;

import dmax.dialog.SpotsDialog;

public class LoadingActivity extends AppCompatActivity implements View.OnClickListener {

    private SpotsDialog dialog;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_loading);

        initView();
    }

    private void initView() {
        dialog = new SpotsDialog(this, "测试。。。",R.style.Custom);
        dialog.show();
        Button mStartButton = findViewById(R.id.mStartButton);
        mStartButton.setOnClickListener(this);
        Button mStopButton = findViewById(R.id.mStopButton);
        mStopButton.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.mStartButton:
                dialog.show();
                break;
            case R.id.mStopButton:
                dialog.dismiss();
                break;
        }
    }
}
